package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysAPeopleListMapper;
import com.ruoyi.system.domain.SysAPeopleList;
import com.ruoyi.system.service.ISysAPeopleListService;
import com.ruoyi.common.core.text.Convert;

/**
 * 便民电话列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-09
 */
@Service
public class SysAPeopleListServiceImpl implements ISysAPeopleListService 
{
    @Autowired
    private SysAPeopleListMapper sysAPeopleListMapper;

    /**
     * 查询便民电话列表
     * 
     * @param peopleId 便民电话列表主键
     * @return 便民电话列表
     */
    @Override
    public SysAPeopleList selectSysAPeopleListByPeopleId(Long peopleId)
    {
        return sysAPeopleListMapper.selectSysAPeopleListByPeopleId(peopleId);
    }

    /**
     * 查询便民电话列表列表
     * 
     * @param sysAPeopleList 便民电话列表
     * @return 便民电话列表
     */
    @Override
    public List<SysAPeopleList> selectSysAPeopleListList(SysAPeopleList sysAPeopleList)
    {
        return sysAPeopleListMapper.selectSysAPeopleListList(sysAPeopleList);
    }

    /**
     * 新增便民电话列表
     * 
     * @param sysAPeopleList 便民电话列表
     * @return 结果
     */
    @Override
    public int insertSysAPeopleList(SysAPeopleList sysAPeopleList)
    {
        if (sysAPeopleList.getPeopleId()==null || "".equals(sysAPeopleList.getPeopleId())) {
            String s = UUID.randomUUID().toString();
            String id = s.substring(s.length()-5,s.length()-1);
            sysAPeopleList.setPeopleId(id);

        }
        return sysAPeopleListMapper.insertSysAPeopleList(sysAPeopleList);
    }

    /**
     * 修改便民电话列表
     * 
     * @param sysAPeopleList 便民电话列表
     * @return 结果
     */
    @Override
    public int updateSysAPeopleList(SysAPeopleList sysAPeopleList)
    {
        return sysAPeopleListMapper.updateSysAPeopleList(sysAPeopleList);
    }

    /**
     * 批量删除便民电话列表
     * 
     * @param peopleIds 需要删除的便民电话列表主键
     * @return 结果
     */
    @Override
    public int deleteSysAPeopleListByPeopleIds(String peopleIds)
    {
        return sysAPeopleListMapper.deleteSysAPeopleListByPeopleIds(Convert.toStrArray(peopleIds));
    }

    /**
     * 删除便民电话列表信息
     * 
     * @param peopleId 便民电话列表主键
     * @return 结果
     */
    @Override
    public int deleteSysAPeopleListByPeopleId(Long peopleId)
    {
        return sysAPeopleListMapper.deleteSysAPeopleListByPeopleId(peopleId);
    }
}
